package com.situ.order.controller;

import com.situ.order.pojo.Order;
import com.situ.order.service.IOrderService;
import com.situ.order.util.JSONResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class OrderController {
    @Autowired
    private IOrderService orderService;

    @GetMapping("/order/{id}")
    public JSONResult selectById(@PathVariable("id") Long id)  {
        System.out.println("id: " + id);
        Order order = orderService.selectById(id);
        return JSONResult.ok(order);
    }
}
